<template>
  <div class="td-patient-me">
    <div class="me-header">
      <div class="me-header-bg">
        <img :src="user.IconPath" alt>
      </div>
      <div class="me-header-user-name">{{user.UserName}}</div>
      <i class="icon font_family icon-td-shezhi" @click="$router.push({name:'tdSetting'})"></i>
    </div>
    <div class="me-menus">
      <mt-cell title="我的资料" is-link @click.native="$router.push({name:'tdBaseInfo'})">
        <img
          slot="icon"
          src="../../../assets/images/patient/me-wodeziliao.png"
          width="24"
          height="24"
        >
      </mt-cell>
      <mt-cell title="配偶信息" is-link @click.native="$router.push({name:'tdMateInfo'})">
        <img
          slot="icon"
          src="../../../assets/images/patient/me-peioxinxi.png"
          width="24"
          height="24"
        >
      </mt-cell>
      <mt-cell title="订单管理" is-link @click.native="$router.push({name:'tdOrder'})">
        <img
          slot="icon"
          src="../../../assets/images/patient/me-peioxinxi.png"
          width="24"
          height="24"
        >
      </mt-cell>
      <mt-cell title="预约记录" is-link @click.native="$router.push({name:'tdAppointmentRecord'})">
        <img
          slot="icon"
          src="../../../assets/images/patient/me-yuyuejilu.png"
          width="24"
          height="24"
        >
      </mt-cell>
      <mt-cell title="病例管理" is-link @click.native="toPath('tdMedical')">
        <img
          slot="icon"
          src="../../../assets/images/patient/me-bingliguanli.png"
          width="24"
          height="24"
        >
      </mt-cell>
      <mt-cell title="下单检测" is-link @click.native="toPath('tdPatientDelection')">
        <img
          slot="icon"
          src="../../../assets/images/patient/me-xiadanjiance.png"
          width="24"
          height="24"
        >
      </mt-cell>
    </div>
  </div>
</template>

<script>
import UserService from "../../../_services/user.service";
export default {
  name: "TianDingPatientMeComponent",
  data() {
    return {
      user: {}
    };
  },
  mounted() {
    this.user = JSON.parse(this.local$.getItem("tdUser"));
  },
  methods: {
    toPath(name) {
      if (this.local$.userEmpty()) {
        this.$router.push({ name: name });
      } else {
        this.$router.push({ name: "tdPatientInfo" });
      }
    }
  }
};
</script>
